<%--
    Document   : listSaleProgram
    Created on : Dec 22, 2009, 12:40:13 AM
    Author     : Ms.MIAYU
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@taglib  prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@taglib  prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">

<table border="1">
    <tr>
        <th colspan="7">Sale Programs List</th>
    </tr>
    <tr>
        <th>#</th>
        <th>Start date</th>
        <th>End date</th>
        <th>Minimum Invoice Value</th>
        <th>Discount Rate</th>
        <th></th>
        <th></th>
    </tr>
    <c:forEach var="saleProgram" items="${salePrograms}" varStatus="counter">
        <tr>
            <td>${counter.count}</td>
            <td><fmt:formatDate value="${saleProgram.startDate}" pattern="MMM d, yyyy"/></td>
            <td><fmt:formatDate value="${saleProgram.endDate}" pattern="MMM d, yyyy"/></td>
            <td>${saleProgram.minimumInvoiceTotal} VND</td>
            <td>${saleProgram.discountRate}</td>
            <td><form method="post"><input type="hidden" name="idToRemove" value="${saleProgram.autoId}"/>
                    <input type="submit" name="delete" value="Delete" onclick="return confirm('Do you want to remove this sale program?');"/>
                </form></td>
            <td><a href="editSaleProgram?id=${saleProgram.autoId}">Edit</a></td>
        </tr>
    </c:forEach>
    <tr><td colspan="7"><a href="editSaleProgram">Add new sale program</a></td></tr>
</table>
